package com.culturalCenter.dataCenter.service.impl.user;

import com.culturalCenter.dataCenter.entity.user.UserActivitySignUpType;
import com.culturalCenter.dataCenter.mapper.user.UserActivitySignUpTypeMapper;
import com.culturalCenter.dataCenter.service.user.UserActivitySignUpTypeService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/****
 * @Author:
 * @Description:UserActivitySignUpType业务层接口实现类
 * @Date
 *****/
@Service
public class UserActivitySignUpTypeServiceImpl implements UserActivitySignUpTypeService {

    @Resource
    private UserActivitySignUpTypeMapper userActivitySignUpTypeMapper;

    @Override
    public PageInfo<UserActivitySignUpType> findPage(int page, int size) {
        return PageHelper.startPage(page, size).doSelectPageInfo(() -> userActivitySignUpTypeMapper.findPageAll());
    }

    @Override
    public Integer delete(String id) {
        return userActivitySignUpTypeMapper.deleteById(id);
    }

    @Override
    public Integer update(UserActivitySignUpType userActivitySignUpType) {
        return userActivitySignUpTypeMapper.update(userActivitySignUpType);
    }

    @Override
    public Integer add(UserActivitySignUpType userActivitySignUpType) {
        return userActivitySignUpTypeMapper.insert(userActivitySignUpType);
    }

    @Override
    public UserActivitySignUpType findById(String id) {
        return userActivitySignUpTypeMapper.queryById(id);
    }

    @Override
    public List<UserActivitySignUpType> findAll(UserActivitySignUpType userActivitySignUpType) {
        return (List<UserActivitySignUpType>) userActivitySignUpTypeMapper.queryAll(userActivitySignUpType);
    }

}
